<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>循环的嵌套</title>
</head>
<body>
    <script>
        var mj,ys,yg,i=0;
        for(mj=0;mj<=20;mj++){
            for(ys=0;ys<=50;ys++){
                for(yg=0;yg<=10;yg++){
                    if(5*mj+2*ys+10*yg==100){
                        document.write(mj+'&nbsp;&nbsp;' ,ys+'&nbsp;&nbsp;' ,yg+'<br>')
                        i++
                    }
                }
            }
        }
        document.write(i);
    </script>
</body>
</html>